<?php

namespace app\controller\api\user;

use think\App;
use crmeb\basic\BaseController;
use app\common\repositories\system\recruit\RecruitRepository as repository;
use think\exception\ValidateException;

class Recruit extends BaseController
{
    /**
     * @var repository
     */
    protected $repository;

    /**
     * UserAddress constructor.
     * @param App $app
     * @param repository $repository
     */
    public function __construct(App $app, repository $repository)
    {
        parent::__construct($app);
        $this->repository = $repository;
    }


    public function lst()
    {
        [$page,$limit] = $this->getPage();
        return app('json')->success($this->repository->getList(['status'=>1],$page,$limit,'sort desc'));
    }

    public function detail($id)
    {
        return app('json')->success($this->repository->get($id));
    }

}
